<template>
  <section class="jumbotron">
    <h3 class="jumbotron-heading">Search Github Users</h3>
    <div>
      <input type="text" placeholder="enter the name you search" v-model="keyword" />&nbsp;
      <button @click="handler(keyword)">Search</button>
    </div>
  </section>
</template>

<script>
export default {
  name: 'Header',
  data(){
    return {
      keyword:''
    }
  },
  methods:{
    handler(){
      // 组件通过actions发送keyword去请求cards
      this.$store.dispatch('getCards',this.keyword)
    }
  }
}
</script>

<style scoped>

</style>
